<div class="container"> 
	<div class="row"> 
		<div class="panel panel-info">
			<div class="panel-heading">
				<div class="panel-title">Domain Transfer</div>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-md-12">
						<div class="well">
							<h1 class="text-center">Domain Transfer</h1>
							<hr style="background:skyblue;height:1px;"/>
							<div class="row">
								<div class="col-md-12">
									<form action="#" method="post" id="domain_transfer">
										<h3 style="margin-bottom:0;color:#E87600">Enter your contact information</h3>
										<p>Please enter the Registrant information as it appears in the current Whois record for this domain name.</p>
										<h4 style="font-weight:normal">Registrant Contact</h4>
										<div class="alert alert-success">
											<label class="radio-inline">
											  <input type="radio" name="UseContacts"  value="1" checked="checked"> Account Contact
											</label>
											<label class="radio-inline">
											  <input type="radio" name="UseContacts"  value="0"> Custom
											</label>
										</div>
										<div class="text-muted" id="registrant_address">
											<span><?=isset($memberdetails['organisation_name']) ? $memberdetails['organisation_name']:''?></span><br>
											<span><?=isset($memberdetails['firstname']) ? $memberdetails['firstname']:''?></span> <span><?=isset($memberdetails['lastname']) ? $memberdetails['lastname']:''?></span><br>
											<span><?=isset($memberdetails['jobtitle']) ? $memberdetails['jobtitle']:''?></span><br>
											<span><?=isset($memberdetails['address1']) ? $memberdetails['address1']:''?></span><br>
											<span><?=isset($memberdetails['address2']) ? $memberdetails['address2']:''?></span>
											<span><?=isset($memberdetails['city']) ? $memberdetails['city']:''?></span>, 
											<span><?=isset($memberdetails['state']) ? $memberdetails['state']:''?></span>,
											<span><?=isset($memberdetails['zip']) ? $memberdetails['zip']:''?></span><br>
											<span><?=isset($memberdetails['country']) ? $memberdetails['country']:''?></span><br>
											<span><?=isset($memberdetails['phone_code']) ? '+'.$memberdetails['phone_code']:''?><?=isset($memberdetails['phone']) ? '.'.$memberdetails['phone']:''?></span><br> 
											<span></span><br>
											<span></span><span><?=isset($memberdetails['account_email']) ? $memberdetails['account_email']:''?></span>
										</div>
										<div id="registrant_form" style="display:none">
											<div class="row">
												<div class="col-md-3">
													<em>First Name</em>
													<input type="text" class="form-control" name="RegistrantFirstName" id="RegistrantFirstName" value="<?=isset($memberdetails['firstname']) ? $memberdetails['firstname']:''?>" placeholder="First Name">
													<input type="hidden" name="TransferOrderDetailID" value="<?=isset($transferdetails['transferorderdetailid']) ? $transferdetails['transferorderdetailid']:''?>">
													<input type="hidden" name="RegistrantStateProvinceChoice" value="<?=isset($memberdetails['rspchoice']) ? $memberdetails['rspchoice']:''?>">
													<input type="hidden" name="transferorderid" value="<?=isset($transferdetails['transferorderid']) ? $transferdetails['transferorderid']:''?>">
													
												</div>
												<div class="col-md-3">
													<em>Last Name</em>
													<input type="text" class="form-control" name="RegistrantLastName" id="RegistrantLastName" value="<?=isset($memberdetails['lastname']) ? $memberdetails['lastname']:''?>" placeholder="last Name">
												</div>
											</div>
											<div class="row">
												<div class="col-md-6">
													<em>Email</em>
													<input type="text" class="form-control" name="RegistrantEmailAddress" id="RegistrantEmailAddress" value="<?=isset($memberdetails['account_email']) ? $memberdetails['account_email']:''?>" placeholder="Email Address (WhoIs)">
												</div>
											</div>
											<div class="row">
												<div class="col-md-3">
													<em>Organization</em>
													<input type="text" class="form-control" id="RegistrantOrganizationName" name="RegistrantOrganizationName" value="<?=isset($memberdetails['organisation_name']) ? $memberdetails['organisation_name']:''?>" placeholder="Organization Name">
												</div>
												<div class="col-md-3">
													<em>Your Title/Role*</em>
													<input type="text" class="form-control" name="RegistrantJobTitle" id="RegistrantJobTitle" value="<?=isset($memberdetails['jobtitle']) ? $memberdetails['jobtitle']:''?>" placeholder="Role/Title">
												</div>
											</div>
											<div class="row">
												<div class="col-md-6">
													<em>Address </em>
													<input type="text" class="form-control" name="RegistrantAddress1" id="RegistrantAddress1" value="<?=isset($memberdetails['address1']) ? $memberdetails['address1']:''?>" placeholder="Postal Address Line 1">
												</div>
											</div>
											<div class="row">
												<div class="col-md-6">
													<em>&nbsp; </em>
													<input type="text" class="form-control" name="RegistrantAddress2" id="RegistrantAddress2" value="<?=isset($memberdetails['address2']) ? $memberdetails['address2']:''?>" placeholder="Postal Address Line 2">
												</div>
											</div>
											<div class="row">
												<div class="col-md-3">
													<em>City </em>
													<input type="text" class="form-control" name="RegistrantCity" id="RegistrantCity" value="<?=isset($memberdetails['city']) ? $memberdetails['city']:''?>" placeholder="City">
												</div>
												<div class="col-md-3">
													<em>Country *</em>
													<select class="form-control" name="RegistrantCountry">
														<option value="">Select Country</option>
														<?php foreach($countries as $country){?>
														<option value="<?=$country['name']?>" <?php if($memberdetails['country']==$country['name']) echo "selected='selected'";?>><?=$country['name']?></option>
														<?}?>
													</select>
												</div>
											</div>
											<div class="row">
												<div class="col-md-3">
													<em>U.S. State *</em>
													<select class="form-control" name="RegistrantStateProvince" id="RegistrantStateProvince">
														<?php foreach($us_states as $states){?>
														<option value="<?=$states['code']?>" <?php if($memberdetails['state']==$states['code']) echo "selected='selected'";?>><?=$states['name']?></option>
														<?}?>
													</select>
												</div>
												<div class="col-md-3">
													<em> Postal/Zip Code *</em>
													<input type="text" class="form-control" name="RegistrantPostalCode" id="RegistrantPostalCode" value="<?=isset($memberdetails['zip']) ? $memberdetails['zip']:''?>" placeholder="Postal or Zip Code">
												</div>
											</div>
											<div class="row">
												<div class="col-md-3">
													<em> Telephone *</em>
													<select class="form-control" name="RegistrantPhonecode">
														<?php foreach($countries as $country){?>
														<option value="<?=$country['phone_code']?>" <?php if($memberdetails['phone_code']==$country['phone_code']) echo "selected='selected'";?>><?=$country['name'].'(+ '.$country['phone_code'].')'?></option>
														<?}?>
													</select>
												</div>
												<div class="col-md-3">
													<em> Area Code & Number </em>
													<input type="text" class="form-control" name="RegistrantPhone" id="RegistrantPhone" value="<?=isset($memberdetails['phone']) ? $memberdetails['phone']:''?>" placeholder="Telephone">
												</div>
											</div>
											<div class="row">
												<div class="col-md-3">
													<em>Fax</em>
													<select class="form-control" name="RegistrantFaxcode">
														<?php foreach($countries as $country){?>
														<option value="<?=$country['phone_code']?>" <?php if($memberdetails['fax_code']==$country['phone_code']) echo "selected='selected'";?>><?=$country['name'].'(+ '.$country['phone_code'].')'?></option>
														<?}?>
													</select>
												</div>
												<div class="col-md-3">
													<em> Area Code & Number </em>
													<input type="text" class="form-control" name="RegistrantFax" id="RegistrantFax" value="<?=isset($memberdetails['fax']) ? $memberdetails['fax']:''?>" placeholder="Fax">
												</div>
											</div>
										</div>
										<p class="footnote" style="margin-top:10px;">
											<strong class="attention">Please note:</strong> We have added a two hour time limit to complete a Pre-configured transfer. You will have two hours from the time you begin the transfer order to the time you submit it. Your card will be Pre-authorized twice if you don't complete your transfer request within that time. This means your card will have the funds reserved and held twice. You will still be charged only once no matter what. Before proceeding, please review the <a href="/terms/transfer_policy.asp">Terms and Conditions</a>.
										</p>
										<hr style="background:skyblue;height:1px;">
										<button type="submit" class="btn btn-warning" onclick="return domaintransfer()">Continue</button>
										<button type="button" class="btn btn-default">Cancel</button>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
$(function(){
	$("input[name=UseContacts]").change(function (){
		var contact=$("input[name=UseContacts]:checked").val();
		if(contact==1)
		{
			$("#registrant_form").hide();
			$("#registrant_address").show();
		}
		else
		{
			$("#registrant_form").show();
			$("#registrant_address").hide();
		}
	});	
});
function domaintransfer()
{
	//alert($('#domain_transfer').serialize());
	$.ajax({
		url: '<?php echo base_url('enom/domaintransfer_contact');?>',
		type: 'post',
		data: $('#domain_transfer').serialize(),
		dataType:'json',
		beforeSend: function() {
			$('#processing-modal').modal('show');
		},		
		complete: function() {
			//$(e).children('.blue').css('background','#F9B014');
			//$(e).children('.blue').children('span').text('checkout');
		},
		success: function(json) {
			if(json['message'])
			{
				$('#ajax_msg').html('<div class="alert alert-success alert-dismissable flashmsg"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>'+ json['message'] + '</div>');
				$('#ajax_msg .flashmsg').delay(5000).fadeOut('slow');
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
				$('#processing-modal').modal('hide');
				$('#contentwrapperinner').html(json['htmlresult']);
			}
			
		}
	});
	return false;
}
</script>
